package lu.uni.adtool.domains.predefined;

import lu.uni.adtool.domains.Domain;

import lu.uni.adtool.domains.rings.Ring;

public class DescriptionGenerator
{
  public static String generateDescription(Domain d, String name,String vd, String[] oper)
  {
    return  "<html><table align=\"left\" border=0>"
        + "<tr><th align=\"left\">"+name+"</th></tr>"
        + "<tr align=\"left\"><table border=0 cellpadding=7>"
        + "<tr border=0><th align=\"left\">Value&nbsp;domain:</th>"
        + "    <td colspan=1><nbr>"+vd+"</nbr></td></tr></table></tr>"
        + "<tr><table border=0>"
        + "<tr><th></th><th border=0>proponent</th><td border=0>&nbsp;&nbsp;&nbsp;&nbsp;</td><th border=0>opponent</th></tr>"
        + "<tr><th align=\"left\">or </th><td colspan=2 border=0><b>op&nbsp; </b>" +   oper[0]
        + "</td><td border=0><b>oo&nbsp; </b>" + oper[2] + "</td></tr>"
        + "<tr><th align=\"left\">and</th><td colspan=2 border=0><b>ap&nbsp; </b>" +   oper[1]
        + "</td><td border=0><b>ao&nbsp; </b>" + oper[3] + "</td></tr>"
        + "<tr><th align=\"left\">counter</th><td colspan=2 border=0><b>cp&nbsp; </b>"+oper[4]
        + "</td><td border=0><b>co&nbsp; </b>" + oper[5] + "</td></tr>"
        + "<tr><th align=\"left\" border=0>default value&nbsp;&nbsp;</th><td colspan=2 border=0>"+((Ring)d.getDefaultValue(true)).toUnicode()
        + "</td><td border=0>"+((Ring)d.getDefaultValue(false)).toUnicode()+"</td></tr>"
        + "<tr><th align=\"left\" border=0>modifiable</th><td colspan=2 border=0>"+(d.isValueModifiable(true)?"Yes":"No")+"</td>" 
        + "<td border=0>"+(d.isValueModifiable(false)?"Yes":"No")+"</td></tr>"
        + "</table></tr>"
        + "</table>"
        + "</html>";
  }
}
